home *** CD-ROM | disk | FTP | other *** search
- property languageID
- global SpeechObj, SpeechErr
-
- on birth me, lmName
- set languageID to 0
- if objectp(SpeechObj) then
- set languageID to mNewLanguage(SpeechObj, lmName)
- if SpeechErr <> 0 then
- alert("New Language failed!" & RETURN & RETURN & "Error:" && SpeechErr)
- end if
- end if
- return me
- end
-
- on mRelease me
- if languageID then
- mRelease(SpeechObj, languageID)
- set languageID to 0
- end if
- end
-
- on mAddPhrase me, phrase, id
- if languageID then
- set err to mAddPhrase(SpeechObj, languageID, phrase, id)
- end if
- return err
- end
-
- on mClear me
- if languageID then
- mClearLanguage(SpeechObj, languageID)
- end if
- end
-
- on mSetLanguage me
- if languageID then
- mSetLanguage(SpeechObj, languageID)
- end if
- end
-
- on mAddField me, textField
- cursor(4)
- updateStage()
- set err to 0
- repeat with index = 1 to the number of lines in textField
- set phrase to line index of textField
- if not (phrase = EMPTY) then
- set err to mAddPhrase(me, phrase, index)
- if err then
- exit repeat
- end if
- end if
- end repeat
- cursor(-1)
- updateStage()
- if err then
- alert("Error" && err && "trying to add line" && index & ", “" & phrase & ".”")
- end if
- end
-
- on mAddItems me, textField, theItem
- cursor(4)
- updateStage()
- set err to 0
- repeat with index = 1 to the number of lines in textField
- set phrase to item theItem of line index of textField
- if not (phrase = EMPTY) then
- set err to mAddPhrase(me, phrase, index)
- if err then
- exit repeat
- end if
- end if
- end repeat
- cursor(-1)
- updateStage()
- if err then
- alert("Error" && err && "trying to add line" && index & ", “" & phrase & ".”")
- end if
- end
-